home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / gaplus.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  30KB  |  784 lines

  1. /***************************************************************************
  2.  
  3. Gaplus (c) 1984 Namco
  4.  
  5. MAME driver by:
  6.     Manuel Abadia <manu@teleline.es>
  7.     Ernesto Corvi <someone@secureshell.com>
  8.  
  9. ***************************************************************************/
  10.  
  11. #include "driver.h"
  12. #include "vidhrdw/generic.h"
  13.  
  14. extern unsigned char *gaplus_snd_sharedram;
  15. extern unsigned char *gaplus_sharedram;
  16. extern unsigned char *gaplus_customio_1, *gaplus_customio_2, *gaplus_customio_3;
  17. extern unsigned char *mappy_soundregs;
  18.  
  19. /* shared memory functions */
  20. READ_HANDLER( gaplus_sharedram_r );
  21. READ_HANDLER( gaplus_snd_sharedram_r );
  22. WRITE_HANDLER( gaplus_sharedram_w );
  23. WRITE_HANDLER( gaplus_snd_sharedram_w );
  24.  
  25. /* custom IO chips functions */
  26. WRITE_HANDLER( gaplus_customio_1_w );
  27. WRITE_HANDLER( gaplus_customio_2_w );
  28. WRITE_HANDLER( gaplus_customio_3_w );
  29. READ_HANDLER( gaplus_customio_1_r );
  30. READ_HANDLER( gaplus_customio_2_r );
  31. READ_HANDLER( gaplus_customio_3_r );
  32. READ_HANDLER( gaplusa_customio_1_r );
  33. READ_HANDLER( gaplusa_customio_2_r );
  34. READ_HANDLER( gaplusa_customio_3_r );
  35. READ_HANDLER( galaga3_customio_1_r );
  36. READ_HANDLER( galaga3_customio_2_r );
  37. READ_HANDLER( galaga3_customio_3_r );
  38.  
  39. extern int gaplus_interrupt_1(void);
  40. WRITE_HANDLER( gaplus_reset_2_3_w );
  41. extern int gaplus_interrupt_2(void);
  42. WRITE_HANDLER( gaplus_interrupt_ctrl_2_w );
  43. extern int gaplus_interrupt_3( void );
  44. WRITE_HANDLER( gaplus_interrupt_ctrl_3a_w );
  45. WRITE_HANDLER( gaplus_interrupt_ctrl_3b_w );
  46.  
  47. extern int gaplus_vh_start( void );
  48. extern void gaplus_vh_stop( void );
  49. extern void gaplus_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  50. extern void gaplus_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  51. extern void gaplus_init_machine(void);
  52. WRITE_HANDLER( gaplus_starfield_control_w );
  53.  
  54. static struct MemoryReadAddress readmem_cpu1[] =
  55. {
  56.     { 0x0000, 0x03ff, videoram_r },                /* video RAM */
  57.     { 0x0400, 0x07ff, colorram_r },                /* color RAM */
  58.     { 0x0800, 0x1fff, gaplus_sharedram_r },        /* shared RAM with CPU #2 & spriteram */
  59.     { 0x6040, 0x63ff, gaplus_snd_sharedram_r }, /* shared RAM with CPU #3 */
  60.     { 0x6800, 0x680f, gaplus_customio_1_r },    /* custom I/O chip #1 interface */
  61.     { 0x6810, 0x681f, gaplus_customio_2_r },    /* custom I/O chip #2 interface */
  62.     { 0x6820, 0x682f, gaplus_customio_3_r },    /* custom I/O chip #3 interface */
  63.     { 0x7820, 0x782f, MRA_RAM },                /* ??? */
  64.     { 0x7c00, 0x7c01, MRA_NOP },                /* ??? */
  65.     { 0xa000, 0xffff, MRA_ROM },                /* ROM */
  66.     { -1 }
  67. };
  68.  
  69. static struct MemoryWriteAddress writemem_cpu1[] =
  70. {
  71.     { 0x0000, 0x03ff, videoram_w, &videoram, &videoram_size },  /* video RAM */
  72.     { 0x0400, 0x07ff, colorram_w, &colorram },                    /* color RAM */
  73.     { 0x0800, 0x1fff, gaplus_sharedram_w, &gaplus_sharedram },    /* shared RAM with CPU #2 */
  74.     { 0x6040, 0x63ff, gaplus_snd_sharedram_w, &gaplus_snd_sharedram }, /* shared RAM with CPU #3 */
  75.     { 0x6800, 0x680f, gaplus_customio_1_w, &gaplus_customio_1 },/* custom I/O chip #1 interface */
  76.     { 0x6810, 0x681f, gaplus_customio_2_w, &gaplus_customio_2 },/* custom I/O chip #2 interface */
  77.     { 0x6820, 0x682f, gaplus_customio_3_w, &gaplus_customio_3 },/* custom I/O chip #3 interface */
  78.     { 0x7820, 0x782f, MWA_RAM },                                /* ??? */
  79. //    { 0x7c00, 0x7c00, MWA_NOP },                                /* ??? */
  80. //    { 0x8400, 0x8400, MWA_NOP },                                /* ??? */
  81.     { 0x8c00, 0x8c00, gaplus_reset_2_3_w },                         /* reset CPU #2 y #3? */
  82. //    { 0x9400, 0x9400, MWA_NOP },                                /* ??? */
  83. //    { 0x9c00, 0x9c00, MWA_NOP },                                /* ??? */
  84.     { 0xa000, 0xa003, gaplus_starfield_control_w },                /* starfield control */
  85.     { 0xa000, 0xffff, MWA_ROM },                                /* ROM */
  86.     { -1 }
  87. };
  88.  
  89. static struct MemoryReadAddress readmem_cpu2[] =
  90. {
  91.     { 0x0000, 0x03ff, videoram_r },                /* video RAM */
  92.     { 0x0400, 0x07ff, colorram_r },                /* color RAM */
  93.     { 0x0800, 0x1fff, gaplus_sharedram_r },        /* shared RAM with CPU #1 & spriteram */
  94.     { 0xa000, 0xffff, MRA_ROM },                /* ROM */
  95.     { -1 }
  96. };
  97.  
  98. static struct MemoryWriteAddress writemem_cpu2[] =
  99. {
  100.     { 0x0000, 0x03ff, videoram_w },                /* video RAM */
  101.     { 0x0400, 0x07ff, colorram_w },                /* color RAM */
  102.     { 0x0800, 0x1fff, gaplus_sharedram_w },        /* shared RAM with CPU #1 */
  103. //    { 0x500f, 0x500f, MWA_NOP },                /* ??? */
  104. //    { 0x6001, 0x6001, MWA_NOP },                /* ??? */
  105.     { 0x6080, 0x6081, gaplus_interrupt_ctrl_2_w },/* IRQ 2 enable */
  106.     { 0xa000, 0xffff, MWA_ROM },                /* ROM */
  107.     { -1 }
  108. };
  109.  
  110. static struct MemoryReadAddress readmem_cpu3[] =
  111. {
  112.     { 0x0000, 0x003f, MRA_RAM },                /* sound registers? */
  113.     { 0x0040, 0x03ff, gaplus_snd_sharedram_r }, /* shared RAM with CPU #1 */
  114. //    { 0x3000, 0x3001, MRA_NOP },                /* ???*/
  115.     { 0xe000, 0xffff, MRA_ROM },                /* ROM */
  116.     { -1 }                          /* end of table */
  117. };
  118.  
  119.     /* CPU 3 (SOUND CPU) write addresses */
  120. static struct MemoryWriteAddress writemem_cpu3[] =
  121. {
  122.     { 0x0000, 0x003f, mappy_sound_w, &mappy_soundregs },/* sound registers */
  123.     { 0x0040, 0x03ff, gaplus_snd_sharedram_w },            /* shared RAM with the main CPU */
  124. //    { 0x2007, 0x2007, MWA_NOP },    /* ??? */
  125.     { 0x3000, 0x3000, watchdog_reset_w },                /* watchdog */
  126.     { 0x4000, 0x4000, gaplus_interrupt_ctrl_3a_w },        /* interrupt enable */
  127.     { 0x6000, 0x6000, gaplus_interrupt_ctrl_3b_w },        /* interrupt disable */
  128.     { 0xe000, 0xffff, MWA_ROM },                        /* ROM */
  129.     { -1 }
  130. };
  131.  
  132. static struct MemoryReadAddress gaplusa_readmem_cpu1[] =
  133. {
  134.     { 0x0000, 0x03ff, videoram_r },                /* video RAM */
  135.     { 0x0400, 0x07ff, colorram_r },                /* color RAM */
  136.     { 0x0800, 0x1fff, gaplus_sharedram_r },        /* shared RAM with CPU #2 & spriteram */
  137.     { 0x6040, 0x63ff, gaplus_snd_sharedram_r }, /* shared RAM with CPU #3 */
  138.     { 0x6800, 0x680f, gaplusa_customio_1_r },    /* custom I/O chip #1 interface */
  139.     { 0x6810, 0x681f, gaplusa_customio_2_r },    /* custom I/O chip #2 interface */
  140.     { 0x6820, 0x682f, gaplusa_customio_3_r },    /* custom I/O chip #3 interface */
  141.     { 0x7820, 0x782f, MRA_RAM },                /* ??? */
  142.     { 0x7c00, 0x7c01, MRA_NOP },                /* ??? */
  143.     { 0xa000, 0xffff, MRA_ROM },                /* ROM */
  144.     { -1 }
  145. };
  146.  
  147. static struct MemoryReadAddress galaga3_readmem_cpu1[] =
  148. {
  149.     { 0x0000, 0x03ff, videoram_r },                /* video RAM */
  150.     { 0x0400, 0x07ff, colorram_r },                /* color RAM */
  151.     { 0x0800, 0x1fff, gaplus_sharedram_r },        /* shared RAM with CPU #2 & spriteram */
  152.     { 0x6040, 0x63ff, gaplus_snd_sharedram_r }, /* shared RAM with CPU #3 */
  153.     { 0x6800, 0x680f, galaga3_customio_1_r },    /* custom I/O chip #1 interface */
  154.     { 0x6810, 0x681f, galaga3_customio_2_r },    /* custom I/O chip #2 interface */
  155.     { 0x6820, 0x682f, galaga3_customio_3_r },    /* custom I/O chip #3 interface */
  156.     { 0x7820, 0x782f, MRA_RAM },                /* ??? */
  157.     { 0x7c00, 0x7c01, MRA_NOP },                /* ??? */
  158.     { 0xa000, 0xffff, MRA_ROM },                /* ROM */
  159.     { -1 }
  160. };
  161.  
  162. /* The dipswitches and player inputs are not memory mapped, they are handled by an I/O chip. */
  163. INPUT_PORTS_START( gaplus )
  164.     PORT_START  /* DSW0 */
  165.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  166.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
  167.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  168.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  169.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  170.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
  171.     PORT_DIPSETTING(    0x04, "2" )
  172.     PORT_DIPSETTING(    0x00, "3" )
  173.     PORT_DIPSETTING(    0x08, "4" )
  174.     PORT_DIPSETTING(    0x0c, "5" )
  175.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  176.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  177.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  178.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
  179.     PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
  180.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  181.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  182.     PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
  183.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  184.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  185.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  186.  
  187.     PORT_START  /* DSW1 */
  188.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
  189.     PORT_DIPSETTING(    0x00, "0" )
  190.     PORT_DIPSETTING(    0x01, "1" )
  191.     PORT_DIPSETTING(    0x02, "2" )
  192.     PORT_DIPSETTING(    0x03, "3" )
  193.     PORT_DIPSETTING(    0x04, "4" )
  194.     PORT_DIPSETTING(    0x05, "5" )
  195.     PORT_DIPSETTING(    0x06, "6" )
  196.     PORT_DIPSETTING(    0x07, "7" )
  197.     PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
  198.     PORT_BITX(    0x10, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  199.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  200.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  201.     PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Bonus_Life ) )
  202.     PORT_DIPSETTING(    0xe0, "30k 70k and every 70k" )
  203.     PORT_DIPSETTING(    0xc0, "30k 100k and every 100k" )
  204.     PORT_DIPSETTING(    0xa0, "30k 100k and every 200k" )
  205.     PORT_DIPSETTING(    0x80, "50k 100k and every 100k" )
  206.     PORT_DIPSETTING(    0x60, "50k 100k and every 200k" )
  207.     PORT_DIPSETTING(    0x00, "50k 150k and every 150k" )
  208.     PORT_DIPSETTING(    0x40, "50k 150k and every 300k" )
  209.     PORT_DIPSETTING(    0x20, "50k 150k" )
  210.  
  211.     PORT_START  /* IN0 */
  212.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_START1, 1 )
  213.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_START2, 1 )
  214.     /* 0x08 service switch (not implemented yet) */
  215.     PORT_BIT_IMPULSE( 0x10, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  216.     PORT_BIT_IMPULSE( 0x20, IP_ACTIVE_HIGH, IPT_COIN2, 1 )
  217.  
  218.     PORT_START  /* IN1 */
  219.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY  )
  220.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY  )
  221.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  222.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  223.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  224.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  225.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  226.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  227.  
  228.     PORT_START  /* IN2 */
  229.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1, 1 )
  230.     PORT_BITX( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1, 0, IP_KEY_PREVIOUS, IP_JOY_PREVIOUS )
  231.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2, 1 )
  232.     PORT_BITX( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2, 0, IP_KEY_PREVIOUS, IP_JOY_PREVIOUS )
  233. INPUT_PORTS_END
  234.  
  235. INPUT_PORTS_START( galaga3 )
  236.     PORT_START  /* DSW0 */
  237.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  238.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
  239.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  240.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  241.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  242.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
  243.     PORT_DIPSETTING(    0x04, "2" )
  244.     PORT_DIPSETTING(    0x00, "3" )
  245.     PORT_DIPSETTING(    0x08, "4" )
  246.     PORT_DIPSETTING(    0x0c, "5" )
  247.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  248.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  249.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  250.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  251.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  252.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  253.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  254.     PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
  255.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  256.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  257.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  258.  
  259.     PORT_START  /* DSW1 */
  260.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
  261.     PORT_DIPSETTING(    0x00, "0" )
  262.     PORT_DIPSETTING(    0x01, "1" )
  263.     PORT_DIPSETTING(    0x02, "2" )
  264.     PORT_DIPSETTING(    0x03, "3" )
  265.     PORT_DIPSETTING(    0x04, "4" )
  266.     PORT_DIPSETTING(    0x05, "5" )
  267.     PORT_DIPSETTING(    0x06, "6" )
  268.     PORT_DIPSETTING(    0x07, "7" )
  269.     PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
  270.     PORT_BITX( 0x10,    0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  271.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  272.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  273.     PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Bonus_Life ) )
  274.     PORT_DIPSETTING(    0xa0, "30k 80k and every 100k" )
  275.     PORT_DIPSETTING(    0x80, "30k 100k and every 100k" )
  276.     PORT_DIPSETTING(    0x60, "30k 100k and every 150k" )
  277.     PORT_DIPSETTING(    0x00, "30k 100k and every 200k" )
  278.     PORT_DIPSETTING(    0x40, "30k 100k and every 300k" )
  279.     PORT_DIPSETTING(    0xe0, "50k 150k and every 150k" )
  280.     PORT_DIPSETTING(    0xc0, "50k 150k and every 200k" )
  281.     PORT_DIPSETTING(    0x20, "30k 150k" )
  282.  
  283.     PORT_START  /* IN0 */
  284.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  285.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2)
  286.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
  287.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
  288.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
  289.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  290.         /* 0x40 service switch (not implemented yet) */
  291.  
  292.     PORT_START  /* IN1 */
  293.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY  )
  294.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY  )
  295.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  296.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  297.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  298.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  299.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  300.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  301.  
  302. INPUT_PORTS_END
  303.  
  304. INPUT_PORTS_START( galaga3a )
  305.     PORT_START  /* DSW0 */
  306.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  307.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
  308.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  309.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  310.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  311.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
  312.     PORT_DIPSETTING(    0x04, "2" )
  313.     PORT_DIPSETTING(    0x00, "3" )
  314.     PORT_DIPSETTING(    0x08, "4" )
  315.     PORT_DIPSETTING(    0x0c, "5" )
  316.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  317.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  318.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  319.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  320.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  321.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  322.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  323.     PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
  324.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  325.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  326.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  327.  
  328.     PORT_START  /* DSW1 */
  329.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
  330.     PORT_DIPSETTING(    0x00, "0" )
  331.     PORT_DIPSETTING(    0x01, "1" )
  332.     PORT_DIPSETTING(    0x02, "2" )
  333.     PORT_DIPSETTING(    0x03, "3" )
  334.     PORT_DIPSETTING(    0x04, "4" )
  335.     PORT_DIPSETTING(    0x05, "5" )
  336.     PORT_DIPSETTING(    0x06, "6" )
  337.     PORT_DIPSETTING(    0x07, "7" )
  338.     PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
  339.     PORT_BITX( 0x10,    0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  340.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  341.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  342.     PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Bonus_Life ) )
  343.     PORT_DIPSETTING(    0xe0, "30k 150k and every 600k" )
  344.     PORT_DIPSETTING(    0xc0, "50k 150k and every 300k" )
  345.     PORT_DIPSETTING(    0x80, "50k 200k and every 300k" )
  346.     PORT_DIPSETTING(    0xa0, "50k 150k and every 600k" )
  347.     PORT_DIPSETTING(    0x60, "100k 300k and every 300k" )
  348.     PORT_DIPSETTING(    0x00, "100k 300k and every 600k" )
  349.     PORT_DIPSETTING(    0x40, "150k 400k and every 900k" )
  350.     PORT_DIPSETTING(    0x20, "150k 400k" )
  351.  
  352.     PORT_START  /* IN0 */
  353.     PORT_BIT(  0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  354.     PORT_BIT(  0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2)
  355.     PORT_BIT(  0x04, IP_ACTIVE_HIGH, IPT_START1 )
  356.     PORT_BIT(  0x08, IP_ACTIVE_HIGH, IPT_START2 )
  357.     PORT_BIT(  0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
  358.     PORT_BIT(  0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  359.         /* 0x40 service switch (not implemented yet) */
  360.  
  361.     PORT_START  /* IN1 */
  362.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY  )
  363.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY  )
  364.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  365.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  366.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  367.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  368.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  369.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  370. INPUT_PORTS_END
  371.  
  372. static struct GfxLayout charlayout1 =
  373. {
  374.     8,8,                                            /* 8*8 characters */
  375.     256,                                            /* 256 characters */
  376.     2,                                                  /* 2 bits per pixel */
  377.     { 4, 6 },                                         /* the 2 bitplanes are packed into one nibble */
  378.     { 16*8, 16*8+1, 24*8, 24*8+1, 0, 1, 8*8, 8*8+1 },
  379.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  380.     32*8
  381. };
  382.  
  383. static struct GfxLayout charlayout2 =
  384. {
  385.     8,8,                                            /* 8*8 characters */
  386.     256,                                            /* 256 characters */
  387.     2,                                                /* 2 bits per pixel */
  388.     { 0, 2 },                                        /* the 2 bitplanes are packed into one nibble */
  389.     { 16*8, 16*8+1, 24*8, 24*8+1, 0, 1, 8*8, 8*8+1 },
  390.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  391.     32*8
  392. };
  393.  
  394. static struct GfxLayout spritelayout1 =
  395. {
  396.     16,16,            /* 16*16 sprites */
  397.     128,            /* 128 sprites */
  398.     3,                /* 3 bits per pixel */
  399.     { 0, 8192*8+0, 8192*8+4 },
  400.     { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3,
  401.       16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  402.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  403.       32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
  404.     64*8           /* every sprite takes 64 bytes */
  405. };
  406.  
  407.  
  408. static struct GfxLayout spritelayout2 =
  409. {
  410.     16,16,            /* 16*16 sprites */
  411.     128,            /* 128 sprites */
  412.     3,                /* 3 bits per pixel */
  413.     { 4, 8192*8*2+0, 8192*8*2+4 },
  414.     { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3,
  415.       16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  416.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  417.       32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
  418.     64*8           /* every sprite takes 64 bytes */
  419. };
  420.  
  421. static struct GfxLayout spritelayout3 = {
  422.     16,16,                                           /* 16*16 sprites */
  423.     128,                                           /* 128 sprites */
  424.     3,                                               /* 3 bits per pixel (one is always 0) */
  425.     { 8192*8+0, 0, 4 },                               /* the two bitplanes are packed into one byte */
  426.     { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3,
  427.         16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  428.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  429.       32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
  430.     64*8                                            /* every sprite takes 64 bytes */
  431. };
  432.  
  433. static struct GfxDecodeInfo gfxdecodeinfo[] =
  434. {
  435.     { REGION_GFX1, 0x0000, &charlayout1,      0, 64 },
  436.     { REGION_GFX1, 0x0000, &charlayout2,      0, 64 },
  437.     { REGION_GFX2, 0x0000, &spritelayout1, 64*4, 64 },
  438.     { REGION_GFX2, 0x0000, &spritelayout2, 64*4, 64 },
  439.     { REGION_GFX2, 0x6000, &spritelayout3, 64*4, 64 },
  440.     { -1 } /* end of table */
  441. };
  442.  
  443. static struct namco_interface namco_interface =
  444. {
  445.     23920,    /* sample rate (approximate value) */
  446.     8,      /* number of voices */
  447.     100,    /* playback volume */
  448.     REGION_SOUND1    /* memory region */
  449. };
  450.  
  451. static const char *gaplus_sample_names[] =
  452. {
  453.     "*galaga",
  454.     "bang.wav",
  455.     0       /* end of array */
  456. };
  457.  
  458. static struct Samplesinterface samples_interface =
  459. {
  460.     1,    /* one channel */
  461.     80,    /* volume */
  462.     gaplus_sample_names
  463. };
  464.  
  465.  
  466.  
  467. static struct MachineDriver machine_driver_gaplus =
  468. {
  469.     /* basic machine hardware  */
  470.     {
  471.         {
  472.             CPU_M6809,            /* MAIN CPU */
  473.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  474.             readmem_cpu1,writemem_cpu1,0,0,
  475.             gaplus_interrupt_1,1
  476.         },
  477.         {
  478.             CPU_M6809,            /* SUB CPU */
  479.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  480.             readmem_cpu2,writemem_cpu2,0,0,
  481.             gaplus_interrupt_2,1
  482.         },
  483.         {
  484.             CPU_M6809,            /* SOUND CPU */
  485.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  486.             readmem_cpu3,writemem_cpu3,0,0,
  487.             gaplus_interrupt_3,1
  488.         }
  489.     },
  490.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  491.     100,    /* a high value to ensure proper synchronization of the CPUs */
  492.     gaplus_init_machine,
  493.  
  494.     /* video hardware */
  495.     36*8, 28*8,
  496.     { 0*8, 36*8-1, 0*8, 28*8-1 },
  497.     gfxdecodeinfo,
  498.     256,
  499.     64*4+64*8,
  500.     gaplus_vh_convert_color_prom,
  501.  
  502.     VIDEO_TYPE_RASTER,
  503.     0,
  504.     gaplus_vh_start,
  505.     gaplus_vh_stop,
  506.     gaplus_vh_screenrefresh,
  507.  
  508.     /* sound hardware */
  509.     0,0,0,0,
  510.     {
  511.         {
  512.             SOUND_NAMCO,
  513.             &namco_interface
  514.         },
  515.         {
  516.             SOUND_SAMPLES,
  517.             &samples_interface
  518.         }
  519.     }
  520. };
  521.  
  522. static struct MachineDriver machine_driver_gaplusa =
  523. {
  524.     /* basic machine hardware  */
  525.     {
  526.         {
  527.             CPU_M6809,            /* MAIN CPU */
  528.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  529.             gaplusa_readmem_cpu1,writemem_cpu1,0,0,
  530.             gaplus_interrupt_1,1
  531.         },
  532.         {
  533.             CPU_M6809,            /* SUB CPU */
  534.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  535.             readmem_cpu2,writemem_cpu2,0,0,
  536.             gaplus_interrupt_2,1
  537.         },
  538.         {
  539.             CPU_M6809,            /* SOUND CPU */
  540.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  541.             readmem_cpu3,writemem_cpu3,0,0,
  542.             gaplus_interrupt_3,1
  543.         }
  544.     },
  545.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  546.     100,    /* a high value to ensure proper synchronization of the CPUs */
  547.     gaplus_init_machine,
  548.  
  549.     /* video hardware */
  550.     36*8, 28*8,
  551.     { 0*8, 36*8-1, 0*8, 28*8-1 },
  552.     gfxdecodeinfo,
  553.     256,
  554.     64*4+64*8,
  555.     gaplus_vh_convert_color_prom,
  556.  
  557.     VIDEO_TYPE_RASTER,
  558.     0,
  559.     gaplus_vh_start,
  560.     gaplus_vh_stop,
  561.     gaplus_vh_screenrefresh,
  562.  
  563.     /* sound hardware */
  564.     0,0,0,0,
  565.     {
  566.         {
  567.             SOUND_NAMCO,
  568.             &namco_interface
  569.         },
  570.         {
  571.             SOUND_SAMPLES,
  572.             &samples_interface
  573.         }
  574.     }
  575. };
  576.  
  577. static struct MachineDriver machine_driver_galaga3 =
  578. {
  579.     /* basic machine hardware  */
  580.     {
  581.         {
  582.             CPU_M6809,            /* MAIN CPU */
  583.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  584.             galaga3_readmem_cpu1,writemem_cpu1,0,0,
  585.             gaplus_interrupt_1,1
  586.         },
  587.         {
  588.             CPU_M6809,            /* SUB CPU */
  589.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  590.             readmem_cpu2,writemem_cpu2,0,0,
  591.             gaplus_interrupt_2,1
  592.         },
  593.         {
  594.             CPU_M6809,            /* SOUND CPU */
  595.             1536000,            /* 24.576 Mhz / 16 = 1.536 Mhz */
  596.             readmem_cpu3,writemem_cpu3,0,0,
  597.             gaplus_interrupt_3,1
  598.         }
  599.     },
  600.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  601.     100,    /* a high value to ensure proper synchronization of the CPUs */
  602.     gaplus_init_machine,
  603.  
  604.     /* video hardware */
  605.     36*8, 28*8,
  606.     { 0*8, 36*8-1, 0*8, 28*8-1 },
  607.     gfxdecodeinfo,
  608.     256,
  609.     64*4+64*8,
  610.     gaplus_vh_convert_color_prom,
  611.  
  612.     VIDEO_TYPE_RASTER,
  613.     0,
  614.     gaplus_vh_start,
  615.     gaplus_vh_stop,
  616.     gaplus_vh_screenrefresh,
  617.  
  618.     /* sound hardware */
  619.     0,0,0,0,
  620.     {
  621.         {
  622.             SOUND_NAMCO,
  623.             &namco_interface
  624.         },
  625.         {
  626.             SOUND_SAMPLES,
  627.             &samples_interface
  628.         }
  629.     }
  630. };
  631.  
  632.  
  633.  
  634. ROM_START( gaplus )
  635.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for the MAIN CPU */
  636.     ROM_LOAD( "gp2-4.64",   0xa000, 0x2000, 0x484f11e0 )
  637.     ROM_LOAD( "gp2-3.64",   0xc000, 0x2000, 0xa74b0266 )
  638.     ROM_LOAD( "gp2-2.64",   0xe000, 0x2000, 0x69fdfdb7 )
  639.  
  640.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the SUB CPU */
  641.     ROM_LOAD( "gp2-8.64",   0xa000, 0x2000, 0xbff601a6 )
  642.     ROM_LOAD( "gp2-7.64",   0xc000, 0x2000, 0x0621f7df )
  643.     ROM_LOAD( "gp2-6.64",   0xe000, 0x2000, 0x14cd61ea )
  644.  
  645.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64k for the SOUND CPU */
  646.     ROM_LOAD( "gp2-1.64",   0xe000, 0x2000, 0xed8aa206 )
  647.  
  648.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  649.     ROM_LOAD( "gp2-5.64",   0x0000, 0x2000, 0xf3d19987 )    /* characters */
  650.  
  651.     ROM_REGION( 0xa000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  652.     ROM_LOAD( "gp2-9.64",   0x0000, 0x2000, 0xe6a9ae67 )    /* objects */
  653.     ROM_LOAD( "gp2-11.64",  0x2000, 0x2000, 0x57740ff9 )    /* objects */
  654.     ROM_LOAD( "gp2-10.64",  0x4000, 0x2000, 0x6cd8ce11 )    /* objects */
  655.     ROM_LOAD( "gp2-12.64",  0x6000, 0x2000, 0x7316a1f1 )    /* objects */
  656.     /* 0xa000-0xbfff empty space to decode sprite set #3 as 3 bits per pixel */
  657.  
  658.     ROM_REGION( 0x0800, REGION_PROMS )
  659.     ROM_LOAD( "gp2-1p.bin",   0x0000, 0x0100, 0xa5091352 )  /* red palette ROM (4 bits) */
  660.     ROM_LOAD( "gp2-1n.bin",   0x0100, 0x0100, 0x8bc8022a )  /* green palette ROM (4 bits) */
  661.     ROM_LOAD( "gp2-2n.bin",   0x0200, 0x0100, 0x8dabc20b )  /* blue palette ROM (4 bits) */
  662.     ROM_LOAD( "gp2-6s.bin",   0x0300, 0x0100, 0x2faa3e09 )  /* char color ROM */
  663.     ROM_LOAD( "gp2-6p.bin",   0x0400, 0x0200, 0x6f99c2da )  /* sprite color ROM (lower 4 bits) */
  664.     ROM_LOAD( "gp2-6n.bin",   0x0600, 0x0200, 0xc7d31657 )  /* sprite color ROM (upper 4 bits) */
  665.  
  666.     ROM_REGION( 0x0100, REGION_SOUND1 ) /* sound prom */
  667.     ROM_LOAD( "gp2-3f.bin",   0x0000, 0x0100, 0x2d9fbdd8 )
  668. ROM_END
  669.  
  670. ROM_START( gaplusa )
  671.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for the MAIN CPU */
  672.     ROM_LOAD( "gp2-4.8d",   0xa000, 0x2000, 0xe525d75d )
  673.     ROM_LOAD( "gp2-3b.8c",  0xc000, 0x2000, 0xd77840a4 )
  674.     ROM_LOAD( "gp2-2b.8b",  0xe000, 0x2000, 0xb3cb90db )
  675.  
  676.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the SUB CPU */
  677.     ROM_LOAD( "gp2-8.11d",  0xa000, 0x2000, 0x42b9fd7c )
  678.     ROM_LOAD( "gp2-7.64",   0xc000, 0x2000, 0x0621f7df )
  679.     ROM_LOAD( "gp2-6.11b",  0xe000, 0x2000, 0x75b18652 )
  680.  
  681.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64k for the SOUND CPU */
  682.     ROM_LOAD( "gp2-1.64",   0xe000, 0x2000, 0xed8aa206 )
  683.  
  684.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  685.     ROM_LOAD( "gp2-5.64",   0x0000, 0x2000, 0xf3d19987 )    /* characters */
  686.  
  687.     ROM_REGION( 0xa000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  688.     ROM_LOAD( "gp2-9.64",   0x0000, 0x2000, 0xe6a9ae67 )    /* objects */
  689.     ROM_LOAD( "gp2-11.64",  0x2000, 0x2000, 0x57740ff9 )    /* objects */
  690.     ROM_LOAD( "gp2-10.64",  0x4000, 0x2000, 0x6cd8ce11 )    /* objects */
  691.     ROM_LOAD( "gp2-12.64",  0x6000, 0x2000, 0x7316a1f1 )    /* objects */
  692.     /* 0xa000-0xbfff empty space to decode sprite set #3 as 3 bits per pixel */
  693.  
  694.     ROM_REGION( 0x0800, REGION_PROMS )
  695.     ROM_LOAD( "gp2-1p.bin",   0x0000, 0x0100, 0xa5091352 )  /* red palette ROM (4 bits) */
  696.     ROM_LOAD( "gp2-1n.bin",   0x0100, 0x0100, 0x8bc8022a )  /* green palette ROM (4 bits) */
  697.     ROM_LOAD( "gp2-2n.bin",   0x0200, 0x0100, 0x8dabc20b )  /* blue palette ROM (4 bits) */
  698.     ROM_LOAD( "gp2-6s.bin",   0x0300, 0x0100, 0x2faa3e09 )  /* char color ROM */
  699.     ROM_LOAD( "gp2-6p.bin",   0x0400, 0x0200, 0x6f99c2da )  /* sprite color ROM (lower 4 bits) */
  700.     ROM_LOAD( "gp2-6n.bin",   0x0600, 0x0200, 0xc7d31657 )  /* sprite color ROM (upper 4 bits) */
  701.  
  702.     ROM_REGION( 0x0100, REGION_SOUND1 ) /* sound prom */
  703.     ROM_LOAD( "gp2-3f.bin",   0x0000, 0x0100, 0x2d9fbdd8 )
  704. ROM_END
  705.  
  706. ROM_START( galaga3 )
  707.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for the MAIN CPU */
  708.     ROM_LOAD( "gal3_9e.bin",   0xa000, 0x2000, 0xf4845e7f )
  709.     ROM_LOAD( "gal3_9d.bin",   0xc000, 0x2000, 0x86fac687 )
  710.     ROM_LOAD( "gal3_9c.bin",   0xe000, 0x2000, 0xf1b00073 )
  711.  
  712.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the SUB CPU */
  713.     ROM_LOAD( "gal3_6l.bin",0xa000, 0x2000, 0x9ec3dce5 )
  714.     ROM_LOAD( "gp2-7.64",   0xc000, 0x2000, 0x0621f7df )
  715.     ROM_LOAD( "gal3_6n.bin",0xe000, 0x2000, 0x6a2942c5 )
  716.  
  717.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64k for the SOUND CPU */
  718.     ROM_LOAD( "gp2-1.64",   0xe000, 0x2000, 0xed8aa206 )
  719.  
  720.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  721.     ROM_LOAD( "gal3_9l.bin",0x0000, 0x2000, 0x8d4dcebf )    /* characters */
  722.  
  723.     ROM_REGION( 0xa000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  724.     ROM_LOAD( "gp2-9.64",   0x0000, 0x2000, 0xe6a9ae67 )    /* objects */
  725.     ROM_LOAD( "gp2-11.64",  0x2000, 0x2000, 0x57740ff9 )    /* objects */
  726.     ROM_LOAD( "gp2-10.64",  0x4000, 0x2000, 0x6cd8ce11 )    /* objects */
  727.     ROM_LOAD( "gp2-12.64",  0x6000, 0x2000, 0x7316a1f1 )    /* objects */
  728.     /* 0xa000-0xbfff empty space to decode sprite set #3 as 3 bits per pixel */
  729.  
  730.     ROM_REGION( 0x0800, REGION_PROMS )
  731.     ROM_LOAD( "gp2-1p.bin",   0x0000, 0x0100, 0xa5091352 )  /* red palette ROM (4 bits) */
  732.     ROM_LOAD( "gp2-1n.bin",   0x0100, 0x0100, 0x8bc8022a )  /* green palette ROM (4 bits) */
  733.     ROM_LOAD( "gp2-2n.bin",   0x0200, 0x0100, 0x8dabc20b )  /* blue palette ROM (4 bits) */
  734.     ROM_LOAD( "gp2-6s.bin",   0x0300, 0x0100, 0x2faa3e09 )  /* char color ROM */
  735.     ROM_LOAD( "g3_3f.bin",    0x0400, 0x0200, 0xd48c0eef )  /* sprite color ROM (lower 4 bits) */
  736.     ROM_LOAD( "g3_3e.bin",    0x0600, 0x0200, 0x417ba0dc )  /* sprite color ROM (upper 4 bits) */
  737.  
  738.     ROM_REGION( 0x0100, REGION_SOUND1 ) /* sound prom */
  739.     ROM_LOAD( "gp2-3f.bin",   0x0000, 0x0100, 0x2d9fbdd8 )
  740. ROM_END
  741.  
  742. ROM_START( galaga3a )
  743.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for the MAIN CPU */
  744.     ROM_LOAD( "mi.9e",         0xa000, 0x2000, 0xe392704e )
  745.     ROM_LOAD( "gal3_9d.bin",   0xc000, 0x2000, 0x86fac687 )
  746.     ROM_LOAD( "gal3_9c.bin",   0xe000, 0x2000, 0xf1b00073 )
  747.  
  748.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the SUB CPU */
  749.     ROM_LOAD( "gal3_6l.bin",0xa000, 0x2000, 0x9ec3dce5 )
  750.     ROM_LOAD( "gp2-7.64",   0xc000, 0x2000, 0x0621f7df )
  751.     ROM_LOAD( "gal3_6n.bin",0xe000, 0x2000, 0x6a2942c5 )
  752.  
  753.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64k for the SOUND CPU */
  754.     ROM_LOAD( "gp2-1.64",   0xe000, 0x2000, 0xed8aa206 )
  755.  
  756.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  757.     ROM_LOAD( "gal3_9l.bin",0x0000, 0x2000, 0x8d4dcebf )    /* characters */
  758.  
  759.     ROM_REGION( 0xa000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  760.     ROM_LOAD( "gp2-9.64",   0x0000, 0x2000, 0xe6a9ae67 )    /* objects */
  761.     ROM_LOAD( "gp2-11.64",  0x2000, 0x2000, 0x57740ff9 )    /* objects */
  762.     ROM_LOAD( "gp2-10.64",  0x4000, 0x2000, 0x6cd8ce11 )    /* objects */
  763.     ROM_LOAD( "gp2-12.64",  0x6000, 0x2000, 0x7316a1f1 )    /* objects */
  764.     /* 0xa000-0xbfff empty space to decode sprite set #3 as 3 bits per pixel */
  765.  
  766.     ROM_REGION( 0x0800, REGION_PROMS )
  767.     ROM_LOAD( "gp2-1p.bin",   0x0000, 0x0100, 0xa5091352 )  /* red palette ROM (4 bits) */
  768.     ROM_LOAD( "gp2-1n.bin",   0x0100, 0x0100, 0x8bc8022a )  /* green palette ROM (4 bits) */
  769.     ROM_LOAD( "gp2-2n.bin",   0x0200, 0x0100, 0x8dabc20b )  /* blue palette ROM (4 bits) */
  770.     ROM_LOAD( "gp2-6s.bin",   0x0300, 0x0100, 0x2faa3e09 )  /* char color ROM */
  771.     ROM_LOAD( "g3_3f.bin",    0x0400, 0x0200, 0xd48c0eef )  /* sprite color ROM (lower 4 bits) */
  772.     ROM_LOAD( "g3_3e.bin",    0x0600, 0x0200, 0x417ba0dc )  /* sprite color ROM (upper 4 bits) */
  773.  
  774.     ROM_REGION( 0x0100, REGION_SOUND1 ) /* sound prom */
  775.     ROM_LOAD( "gp2-3f.bin",   0x0000, 0x0100, 0x2d9fbdd8 )
  776. ROM_END
  777.  
  778.  
  779.  
  780. GAME( 1984, gaplus,   0,      gaplus,  gaplus,   0, ROT90, "Namco", "Gaplus (set 1)" )
  781. GAME( 1984, gaplusa,  gaplus, gaplusa, gaplus,   0, ROT90, "Namco", "Gaplus (set 2)" )
  782. GAME( 1984, galaga3,  gaplus, galaga3, galaga3,  0, ROT90, "Namco", "Galaga 3 (set 1)" )
  783. GAME( 1984, galaga3a, gaplus, galaga3, galaga3a, 0, ROT90, "Namco", "Galaga 3 (set 2)" )
  784.